// --------------------------------------------------
// 按钮
// @Author: steven.wjx
// @Date:   2020-03-05 13:17:50
// --------------------------------------------------
.#{$ui-name}btn {
    font-size: $font-size;
    height: $btn-height;
    line-height: 1;
    padding: $btn-padding $btn-padding*3;
    @include inline-block;
    margin-bottom: 0; // For input.btn
    text-align: center;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
    background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
    white-space: nowrap;
    transition: all 0.8s ease;
    outline: 0;
    border: 1px solid $border-color;
    border-radius: $border-radius/2;
    text-decoration: none;

    .hiicon {
        vertical-align: baseline;
    }

    @include hover-focus {
        text-decoration: none;
        background-image: none;
        outline: 0;
    }

    &.#{$ui-name}btn-disabled,
    &[disabled],
    fieldset[disabled] & {
        color: $disabled-color;
        border-color: $disabled-border-color;
        background-color: $disabled-bg;
        cursor: not-allowed;

        @include hover-focus {
            color: $disabled-color;
            border-color: $disabled-border-color;
            background-color: $disabled-bg;
        }
    }

    // [converter] extracted a& to a.btn
}

a.#{$ui-name}btn {
    height: $btn-height - $btn-padding * 2;
    line-height: $btn-height - $btn-padding * 2;

    &.#{$ui-name}btn-disabled,
    &[disabled] & {
        pointer-events: none; // Future-proof disabling of clicks on `<a>` elements
    }
}


// Alternate buttons
// --------------------------------------------------

.#{$ui-name}btn-primary {
    @include button-color($primary-color);
}

// info
.#{$ui-name}btn-info {
    @include button-color($info-color);
}

// Success appears as green
.#{$ui-name}btn-success {
    @include button-color($success-color);
}

// Warning appears as orange
.#{$ui-name}btn-warning {
    @include button-color($warning-color);
}

// Danger and danger appear as red
.#{$ui-name}btn-danger {
    @include button-color($danger-color);
}

.#{$ui-name}btn-primary-outline {
    @include button-outline-color($primary-color);
}

.#{$ui-name}btn-info-outline {
    @include button-outline-color($info-color);
}

// Success appears as green
.#{$ui-name}btn-success-outline {
    @include button-outline-color($success-color);
}

// Warning appears as orange
.#{$ui-name}btn-warning-outline {
    @include button-outline-color($warning-color);
}

// Danger and danger appear as red
.#{$ui-name}btn-danger-outline {
    @include button-outline-color($danger-color);
}


// Link buttons
// -------------------------

// Make a button look and behave like a link
.#{$ui-name}btn-link {
    height: auto;
    color: $primary-color;
    font-weight: normal;
    border: 0;
    padding: 0;
    background: none;

    @include hover-focus {
        color: darken($primary-color, 10%);
        text-decoration: none;
        background-color: transparent;
        transition: all 1s ease;
    }

    &:active {
        color: darken($primary-color, 20%);
    }
}


// Block button
// --------------------------------------------------

.#{$ui-name}btn-block {
    display: block;
    width: 100%;
}

.#{$ui-name}btn-round {
    border-radius: $btn-height;
}

.#{$ui-name}btn-circle {
    width: $btn-height;
    height: $btn-height;
    line-height: $btn-height;
    text-align: center;
    border-radius: 50%;
    padding: 0;

    .icon {
        margin-right: 0;
    }
}

// Vertically space out multiple block buttons
.#{$ui-name}btn-block+.#{$ui-name}btn-block {
    margin-top: 5px;
}

.#{$ui-name}btn-group {
    &.#{$ui-name}btn-group-horizontal {
        font-size: 0;

        .#{$ui-name}btn {
            border-left-color: transparent;
            border-radius: 0;

            &:first-child {
                border-radius: $border-radius/2 0 0 $border-radius/2;
            }

            &:last-child {
                border-radius: 0 $border-radius/2 $border-radius/2 0;
            }
        }
    }

    &.#{$ui-name}btn-group-vertical {
        font-size: 0;

        .#{$ui-name}btn {
            display: block;
            border-top-color: transparent;
            border-radius: 0;

            &:first-child {
                border-radius: $border-radius/2 $border-radius/2 0 0;
            }

            &:last-child {
                border-radius: 0 0 $border-radius/2 $border-radius/2;
            }
        }
    }
}

// Specificity overrides
input[type="submit"],
input[type="reset"],
input[type="button"] {
    &.#{$ui-name}btn-block {
        width: 100%;
    }
}